<?php include 'includes/pagetop.php';?>
	
<?php include 'includes/navigation.php';?>

<?php include 'includes/tabletopcontainer.php';?>



<?php if ($action == ''): ?>

	   <div id="content-table-inner">
		
			<!--  start table-content  -->
			<div id="table-content">
				<form method="post" action="{url}/{page}/<?php echo $action == 'edit' ? 'update' : 'add'; ?>/">
				<table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">

				<tr>
					<th class="table-header-repeat line-left minwidth-1"><a href="">Transaction #</a>	</th>
					<th class="table-header-repeat line-left minwidth-1"><a href="">Customer Name</a></th>
					<th class="table-header-repeat line-left"><a href="">Status</a></th>
					<th class="table-header-repeat line-left"><a href="">Transaction Date</a></th>
					<th class="table-header-repeat line-left"><a href="">Total</a></th>
					<th class="table-header-options line-left"><a href="">Action</a></th>
				</tr>
					<?php if (isset($orderedDealList)): ?>
						<?php forEach($orderedDealList as $_orderedDeal){?>
						<tr class="alternate-row">
							<td><?=$_orderedDeal->ordered_deal_id?></td>
							<td><?=$_orderedDeal->client_fullname?></td> 
							<td><?=$_orderedDeal->order_status?></td> 
							<td><?=$_orderedDeal->od_created_on?></td>
							<td><?=$_orderedDeal->total_amount?></td>
							<td class="options-width">
							<a href="{url}/{page}/edit/<?=$_orderedDeal->ordered_deal_id?>" title="Edit" class="icon-1 info-tooltip"></a>
							</td>
						</tr>
						<?php }?>
					<?php endif; ?>

				</table>
				<!--  end product-table................................... --> 
				</form>
			</div>
			<!--  end content-table  -->
		
			<!--  start actions-box ............................................... -->
			<div id="actions-box">
				<a href="" class="action-slider"></a>
				<div id="actions-box-slider">
					<a href="" class="action-edit">Edit</a>
					<a href="" class="action-delete">Delete</a>
				</div>
				<div class="clear"></div>
			</div>
			<!-- end actions-box........... -->
			

			<!--  end paging................ -->
			
			<div class="clear"></div>
		 
		</div>
		<!--  end content-table-inner ............................................END  -->
		</td>
	      
	
<?php elseif($action == 'add' || $action == 'edit' ): ?>   
<?php
?>
	    <form method="post" action="{url}/{page}/<?php echo $action == 'edit' ? 'update' : 'add'; ?>/">
		<input type="hidden" name="id" value="{id}" />
	
           	 
		<!--  start step-holder -->
		<div id="step-holder">
			<div class="step-no">1</div>
			<div class="step-dark-left">Ordered Deal Details</div>
			<div class="step-dark-round">&nbsp;</div>
			<div class="clear"></div>
		</div>

		<!--  end step-holder -->
	
		<!-- start id-form -->
		<table border="0" cellpadding="0" cellspacing="0"  id="id-form">
		<tr>
		<th valign="top" colspan="3">Update Order Status</th>
		</tr>

	<tr>
		<th valign="top">Status:</th>
		<td>
			<select name="status" class="styledselect_pages" style="width:40px">
			<option value="">--select--</option>
			<option value="PAID" <?=((isset($orderedDealData->status) && $orderedDealData->status == 'PAID')?'selected':'');?>>PAID</option>
			<option value="HOLD" <?=((isset($orderedDealData->status) && $orderedDealData->status == 'HOLD')?'selected':'');?>>HOLD</option>
			<option value="PENDING" <?=((isset($orderedDealData->status) && $orderedDealData->status == 'PENDING')?'selected':'');?>>PENDING</option>
			</select>

		</td>
		<td></td>
	</tr>
	<tr>
		<th>&nbsp;</th>
		<td valign="top">
			<input type="submit" value="" class="form-submit" />
			<input type="reset" value="" class="form-reset"  />
		</td>
		<td></td>
	</tr>
	<tr>
		<th valign="top">Total Amount:</th>
		<td><input type="text" class="inp-form"  name="name" value="<?=(isset($orderedDealData->total_amount )?$orderedDealData->total_amount :'');?>"/></td>
		<td></td>
	</tr>
	

	<tr>
		<th valign="top">Deal Id:</th>
		<td><input type="text" class="inp-form"  name="name" value="<?=(isset($orderedDealData->deal_id)?$orderedDealData->deal_id:'');?>"/></td>
		<td></td>
	</tr>
	
		<tr>
		<th valign="top">Mode of Payment:</th>
		<td><input type="text" class="inp-form"  name="name" value="<?=(isset($orderedDealData->modeofpayment)?$orderedDealData->modeofpayment:'');?>"/></td>
		<td></td>
	</tr>
	
	<tr>
		<th valign="top">Send As Gift:</th>
		<td><input type="text" class="inp-form"  name="name" value="<?=((isset($orderedDealData->sendasgift) && $orderedDealData->sendasgift == 0)?'YES':'NO');?>"/></td>
		<td></td>
	</tr>

	<tr>
		<th valign="top">Receipient Fullname:</th>
		<td><input type="text" class="inp-form"  name="name" value="<?=(isset($orderedDealData->receipient_fullname)?$orderedDealData->receipient_fullname:'');?>"/></td>
		<td></td>
	</tr>
	
		<tr>
		<th valign="top">Receipient Email:</th>
		<td><input type="text" class="inp-form"  name="name" value="<?=(isset($orderedDealData->receipient_fullname)?$orderedDealData->receipient_fullname:'');?>"/></td>
		<td></td>
	</tr>
	
	<tr>
		<th valign="top">Receipient Address:</th>
		<td><input type="text" class="inp-form"  name="name" value="<?=(isset($orderedDealData->receipient_address)?$orderedDealData->receipient_address:'');?>"/></td>
		<td></td>
	</tr>
	
		
	<tr>
		<th valign="top" colspan="3">Client Details</th>
	</tr>
	
		<tr>
		<th valign="top">Client Fullname:</th>
		<td><input type="text" class="inp-form"  name="name" value="<?=(isset($orderedDealData->client_fullname)?$orderedDealData->client_fullname:'');?>"/></td>
		<td></td>
	</tr>
	
		<tr>
		<th valign="top">Client Email:</th>
		<td><input type="text" class="inp-form"  name="name" value="<?=(isset($orderedDealData->client_fullname)?$orderedDealData->client_fullname:'');?>"/></td>
		<td></td>
	</tr>
	
	<tr>
		<th valign="top">Client Address:</th>
		<td><input type="text" class="inp-form"  name="name" value="<?=(isset($orderedDealData->client_address)?$orderedDealData->client_address:'');?>"/></td>
		<td></td>
	</tr>
	
	
	<tr>
		<th valign="top">Receipient Notes:</th>
		<td><input type="text" class="inp-form"  name="name" value="<?=(isset($orderedDealData->receipient_notes)?$orderedDealData->receipient_notes:'');?>"/></td>
		<td></td>
	</tr>
	
	<tr>
		<th valign="top">Tenant Name:</th>
		<td><input type="text" class="inp-form"  name="name" value="<?=(isset($tenant->name )?$tenant->name :'');?>"/></td>
		<td></td>
	</tr>
	
	<tr>
		<th valign="top">Tenant Address:</th>
		<td><input type="text" class="inp-form"  name="name" value="<?=(isset($tenant->address )?$tenant->address :'');?>"/></td>
		<td></td>
	</tr>

	</table>

	<div class="clear">
	</div>
					
	<!-- end id-form  -->
<?php endif; ?> 

<?php include 'includes/tablebottomcontainer.php';?>